﻿@model IEnumerable<BTKERP.Model.Warehouse>

@{
    ViewBag.Title = "Warehouse";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section AdditionalJS
{
 <script type="text/javascript">

     function createWareHouse() {
         //$("#dialog").dialog({width:"auto"});
         window.location = "/Warehouse/Create";
     }
 </script>

}

<h2>Warehouse</h2>

<input type="button" value="Create New"  class="btn btn-green" onclick="createWareHouse()" />
<div id="dialog" style="display:none" >
sb
</div>
<table class="display stylized">
    <tr>
        <th>
            Name
        </th>
        <th>
            Descriptoin
        </th>
        <th>
            Address1
        </th>
        <th>
            Address2
        </th>
        <th>
            Address3
        </th>
        <th>
            PostCode
        </th>
        <th>
            Tel
        </th>
        <th>
            Fax
        </th>
        <th>
            ContactPerson
        </th>
        <th>
            Coutry
        </th>
        <th>
            City
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Descriptoin)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Address1)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Address2)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Address3)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PostCode)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Tel)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Fax)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ContactPerson)
        </td>
        <td>
            @BTKERP.MVCWeb.AppCode.DataRefHelper.GetCountryById(item.CoutryId)
        </td>
        <td>
            @BTKERP.MVCWeb.AppCode.DataRefHelper.GetCityById(item.CityId)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>
